package ink.yuanchu.picachoframework.timedTask;

import ink.yuanchu.picachoframework.entity.TimedTask;
import ink.yuanchu.picachoframework.service.TimedTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * 定时任务  清除已逻辑删除的数据
 * @author ziyuan
 * @Date: 2021/03/30/16:38
 * @Description:
 */
@Component
public class ClearLogicallyDeletedData {

    @Autowired
    private TimedTaskService timedTaskService;

//    @Scheduled(cron = "0/4 * * * * ?")
//    public void roleAssociatedPermissionsTableClearLogicallyDeletedData() {
//        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
//        TimedTask byTaskName = timedTaskService.findByTaskName(methodName);
//        boolean aTrue = byTaskName.getStatus().equals("true");
//        if (aTrue){
//            System.out.println("clear");
//        }else {
//            System.out.println("off");
//        }
//    }
}
